#ifndef __PTHREADPOOL_H
#define __PTHREADPOOL_H

#include "common.h"
#include <pthread.h>
#include <signal.h>

typedef struct thread
{
    pthread_t	tid;
	int		number;
	int		sock;
	volatile sig_atomic_t	status;
	pthread_mutex_t	mutex;
	pthread_cond_t	cond;
	thread*		next;
}thread;

class pthreadpool
{
public:
	pthreadpool();
	bool _create_(int);
	bool _wake_(int);
	//bool _sleep_();
	static void* func(void*);
private:
	thread* head;
	static const int STOP = 0;
	static const int RUN  = 1;
};

#endif
